// src/components/Admin/sign/signInMore.tsx
import React from 'react';
import { MoreOutlined, SmileOutlined } from '@ant-design/icons';
import type { MenuProps } from 'antd';
import  { message } from 'antd';
import { Dropdown, Space } from 'antd';
import { useNavigate } from 'react-router-dom';
import styled from '@emotion/styled';

const SignInMore: React.FC = () => {
  const navigate = useNavigate();
  
  const handleMenuClick: MenuProps['onClick'] = (e) => {
      if (e.key === '1') {
          // message.info('click:忘记密码.');
          navigate('/forgotPassword');
      } else if (e.key === '2') {
          // 跳转到注册页面
          navigate('/register');
      }
  };

  const items: MenuProps['items'] = [
    {
      key: '1',
      label:'忘记密码',
      // label: (
      //   <a target="_blank" rel="noopener noreferrer" href="https://www.antgroup.com">
      //     注册
      //   </a>
      // ),
    },
    {
      key: '2',
      label: '注册',
      icon: <SmileOutlined />,
    },
  ];

  const menuProps = {
      items,
      onClick: handleMenuClick
  };

  return (
    //trigger={['click']} 鼠标点击，去掉这个，鼠标悬停
    <Dropdown menu={menuProps} overlayStyle={{ width: '120px' }}>
      <Space style={{ padding: '0 8px' }}>
        <MoreOutlined />
      </Space>
    </Dropdown>
  );
};

export default SignInMore;